package com.example.shixunandjavagotoyangchen.Eternity.StartActivity;

import android.animation.ObjectAnimator;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.util.ToastUtils;
import com.example.shixunandjavagotoyangchen.R;

@Route(path = "/qidong/start")
public class StartActivity extends AppCompatActivity {

    Handler handler = new Handler() {
        @Override
        public void handleMessage(@NonNull Message msg) {
            super.handleMessage(msg);
            if (msg.what == 120) {
                ARouter.getInstance()
                        .build("/start/yindao")
                        .withString("start","开始")
                        .navigation();
                finish();
            }
        }
    };
    private ImageView startImg;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);
        initView();
        Intent intent = getIntent();
        String qidong = intent.getStringExtra("qidong");
        ToastUtils.showShort(""+qidong);
        onWindowFocusChanged(true);
        handler.sendEmptyMessageDelayed(120, 7 * 1000);
        ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(startImg,"Rotation",0,360);
        objectAnimator.setDuration(7000);
        objectAnimator.start();

    }

    private void initView() {
        startImg = (ImageView) findViewById(R.id.start_img);
    }




}
